from common.mssql_helper import g_msql_inst
from common.utils import create_uuid

__author__ = "Ypf"
_date_ = "2019/9/12-10:39"


class Yjdh(object):
    @staticmethod
    def get_yjdh(sql,db_insert_sql,time):
        res_list1 = g_msql_inst.fetch_all(sql)
        for (cgrq,gys,djbh,pp,wlmc,ggxh,sl,bb,slv,hsdj,jshj,jqrq,yjdhsj,yjdhsj) in res_list1:
            list1=[cgrq,gys,djbh,pp,wlmc,ggxh,sl,bb,slv,hsdj,jshj,jqrq,yjdhsj,yjdhsj]
            id = create_uuid()
            list1.append(time + '-01')
            list1.append(id)
            value_tuple = tuple(list1)
            print(value_tuple)
            excuete_sql = db_insert_sql % value_tuple
            print(excuete_sql)
            g_msql_inst.db_excuete(excuete_sql)